ラ Have you ever wondered where all your Mac's CPU processing power is going? Or why the Finder 7 looks slow even on 68040-based Macs? Rumors are that your machine is spending most of its time in the Operating System and Mac Toolbox routines (implemented through the 680x0 A-Trap mechanism). Cool. But what routines are being called? And are they all necessary, or is the Mac just running in circles?
ラ Trapper is a Control Panel/Extension combination that keeps track of ALL system routines (or "traps") by filtering the standard 680x0 trap dispatcher with a very compact counter routine. The Mac's speed won't be visibly affected (it'll be losing about 1 or 2 percent) and you'll be able to see ALL the system routines (even the undocumented ones) along with the number of times they have been called. Since this is a fairly large amount of data, it is stored into a text file for easy reading.
・ Technical info
ラ When I wrote this thing, my IIcx running 7.0.1 was calling something like 10000 traps per second. Running the Finder alone (without any extension at all except for the System 7 Tuner) and leaving it completely unattended for ten minutes gave the following results (a 'tick' is a 60th of second):
- BlockMove was called 60 times per second (once per tick)
- EmptyRgn was called 126 times per second (twice per tick)
- FMSwapFont was called 193 times per second (3 times per tick)
- FrontWindow was called 123 times per second (twice per tick)
- GetFontInfo was called 192 times per second (3 times per tick)
- GetHandleSize was called 60 times per second (once per tick)
- GetPort was called 100 times per second (almost twice per tick)
- OSDispatch was called 132 times per second (twice per tick)
- OSEventAvail was called 1783 times per second (30 times per tick)
- Pack14 was called 77 times per second (once per tick)
- EmptyRgn was called 154 times per second (3 times per tick)
- ScriptUtil was called 384 times per second (6 times per tick)
- SetPort was called 180 times per second (3 times per tick)
- StackSpace was called 196 times per second (3 times per tick)
- StripAddress was called 90 times per second (1.5 times per tick)
- TextFace was called 384 times per second (6 times per tick)
- TextFont was called 192 times per second (3 times per tick)
- TextSize was called 192 times per second (3 times per tick)
- TickCount was called 73 times per second (once per tick)
- UseResFile was called 58 times per second (once per tick)
- $A0DD was called 1780 times per second (30 times per tick)
- $A829 was called 235 times per second (4 times per tick)
- $ABF7 was called 1780 times per second (30 times per tick)
ラ Note that unless my counter is wrong, the Finder is changing its text font 192 times per second - even though it isn't drawing anything at all (I wasn't even moving the mouse!). The text face (things like bold, italic and so on) is changed 384 times per second. If anyone's got a good reason for this, please let me know.
・ Memory usage
ラ Trapper takes about 6K of system memory when installed. The file takes about 28K of disk space (mostly because of the Control Panel's A-Traps database).
・ The control panel
ラ The Control Panel has three important buttons:
1. [Save Count Fileノ] Saves a text file containing a list of all the A-Traps that have been called after Trapper was installed (or reset);
2. [Count File Optionsノ] Displays a dialog with some options for the text file format;
3. [Reset A-Traps Count] Resets the A-Traps counter to all 0's.
・ Version history
ラ 1.0.5 - Now freeware, updated documentation;
ラ 1.04 - Minor fixes;
ラ 1.03 - Added unknown traps count in the output file;
ラ 1.02 - Turned the extension into an easier-to-configure Control Panel;
ラ 1.01 - First vector-tables version, uses an extension/application combo;
ラ 1.00 - First cut using a single trap patch to track _SetPort.
・ Distribution
ラ This software is ゥ1992-96 Alessandro Levi Montalcini. It can be freely distributed as long as it is not modified and thereユs no charge for it, but it may not be included in any commercial package without my consent.
ラ All online services and bulletin boards may make it available to their users at no charge other than the normal connection fees.
ラ All non-profit user groups may distribute it at no charge.
ラ All magazines may publish it on floppy disk or CD-ROM without asking me first, as long as I get a copy of the issue containing my software.
ラ All CD-ROM shareware collections and CD-ROM magazines may include it without my prior consent, as long as I get either a copy of the CD-ROM or an offer to buy the CD-ROM at a discounted price.
ラ All redistribution companies such as Pacific HiTech, AMUG, Celestin or Educorp may distribute it, as long as I get a copy of each media containing my software and a catalog of the companyユs offerings (where applicable).
ラ You may find the latest version of all my shareware and freeware programs by anonymous ftp to ftp.alpcom.it, inside the /software/mac/LMontalcini directory. The ALM Share and ALM Free packages, which contain most of my stuff and can be registered at a very low price, are also available there.
・ Disclaimer
ラ This software should never cause any damage, but youユre using it at your own risk. As an independent software developer, I can make no warranties whatsoever on it.
・ Have fun!
ラ And donユt forget to register your shareware, so that more cool inexpensive utilities can see the light in the future.